Skip to content

2.0: Hide Pekko types from the embedding API, move the server into its module - #1275

Merged
micossow merged 2 commits into
masterfrom
embedding-api-2.0
Nov 7, 2026
Merged

micossow merged 2 commits into
masterfrom
embedding-api-2.0

Conversation

@micossow

@micossow micossow commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Implements the "Embedding API (elasticmq-rest-sqs)" items from docs/BACKLOG.md.

Changes

  • TheSQSRestServerBuilder is no longer a case class. Its constructor, fields and copy are private; configuration goes through SQSRestServerBuilder.withX(...) only, so new options no longer break binary compatibility.
  • Pekko types removed from the public builder API, except withActorSystem(ActorSystem), which stays: the HTTP layer needs an actor system anyway, and users who pass their own already depend on Pekko.
    • withQueueEventListener takes a new QueueEventListener trait instead of an ActorRef. It has optional callbacks (queueCreated, queueDeleted, queueMetadataUpdated, messageAdded, messageUpdated, messageRemoved) that receive QueueData/MessageData. They are called one at a time; the message callbacks finish before the SQS response is sent. Exceptions are logged and ignored.
    • withQueueManagerActor is now private[elasticmq], used only by ElasticMQServer and the SQL persistence tests.
    • SQSRestServer.waitUntilStarted() returns SQSRestServerBinding(localAddress) instead of Pekko's Http.ServerBinding. SQSRestServer is no longer a case class, and stopAndGetFuture() returns Future[Unit].
  • ElasticMQServer, ElasticMQServerConfig, their test and the server reference.conf move to the server module (same packages). elasticmq-rest-sqs now depends only on persistence-core, not on persistence-file/persistence-sql (H2, ScalikeJDBC, PureConfig).
  • Builder Scaladoc fixed (default limits are strict, not relaxed).
  • README embedding section updated (listener, actor system, Java example).
  • performance-tests compile again (a missing type annotation broke them on both Scala versions).

Breaking changes for embedders

  • Code calling the TheSQSRestServerBuilder(...) constructor, copy or its fields.
  • withQueueEventListener(ActorRef) → implement QueueEventListener.
  • withQueueManagerActor removed from the public API, so persistence can no longer be wired into the builder. A withPersistence(...) option can follow in a 2.x minor if needed.
  • waitUntilStarted().localAddress is now java.net.InetSocketAddress on SQSRestServerBinding.
  • ElasticMQServer requires the elasticmq-server artifact.

Testing

  • New QueueEventListenerTests: every callback against a real server, and a listener that throws.
  • Full sbt test on Scala 2.13. On Scala 3: server, restSqs, plus the listener, SQL persistence and auto-create integration tests.
  • server/assembly jar started with server/docker/elasticmq.conf: health check and ListQueues work; the merged reference.conf contains both the rest-sqs and server sections.

🤖 Generated with Claude Code

micossow and others added 2 commits November 7, 2026 15:54
…module

- TheSQSRestServerBuilder is no longer a case class: its constructor, fields
  and copy are private, so new options no longer break binary compatibility.
- withQueueEventListener takes a QueueEventListener trait (callbacks with
  QueueData/MessageData) instead of an ActorRef; withQueueManagerActor is
  internal. withActorSystem stays public.
- SQSRestServer.waitUntilStarted returns SQSRestServerBinding instead of
  Pekko's Http.ServerBinding; stopAndGetFuture returns Future[Unit].
- ElasticMQServer, ElasticMQServerConfig and the server reference.conf move
  to the server module; rest-sqs now depends only on persistence-core.
- Fix the builder Scaladoc (default limits are strict) and the performance
  tests compilation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@micossow
micossow merged commit 430c830 into master Nov 7, 2026
28 checks passed
@micossow
micossow deleted the embedding-api-2.0 branch November 7, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant